MSVC Builds: Apply Visual Style for Win32 Print Dialog
authorChun-wei Fan <fanchunwei@src.gnome.org>
Thu, 7 Aug 2014 15:02:13 +0000 (23:02 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Thu, 7 Aug 2014 15:02:13 +0000 (23:02 +0800)
Define ISOLATION_AWARE_ENABLED for the build of the GTK DLL so that visual
style can be applied to the Windows print dialog for all applications using
gtkprintoperation.

Update the script for the generation of gtk-win32.rc for MSVC to not try to
embed the manifest from it (but embed libgtk3.manifest by including it in
the project files, as we are now doing), and embedding the manifest file is
really not supported in MSVC 2010 and later.

Also fix up formatting in the GTK DLL projects.

https://bugzilla.gnome.org/show_bug.cgi?id=733773

build/win32/process-in-win32.py
build/win32/vs10/gtk-build-defines.props
build/win32/vs10/gtk.vcxprojin
build/win32/vs9/gtk-build-defines.vsprops
build/win32/vs9/gtk.vcprojin

index ca5c80ad48d66045fd239932624ae10a2c1759a4..86be09a5879a2fccc42a3b220ea9499447912fe5 100644 (file)
@@ -79,9 +79,19 @@ def main(argv):
 
         ver = get_version(srcroot)
 
+        target = os.path.join(srcroot, 'gtk', 'gtk-win32.rc')
         process_in(os.path.join(srcroot, 'gtk', 'gtk-win32.rc.in'),
-                   os.path.join(srcroot, 'gtk', 'gtk-win32.rc'),
+                   target + '.intermediate',
                    ver)
+        fp_r = open_compat(target + '.intermediate', 'r')
+        lines = fp_r.readlines()
+        fp_r.close()
+        fp_w = open_compat(target, 'w')
+        fp_w.writelines([item for item in lines[:-1]])
+
+        fp_w.close()
+        os.unlink(target + '.intermediate')
+
         no_args = False
 
     if args.gtk3manifest is not None:
index c79f19b26caec24f1415f7a9388f5717be284b97..6bc67ec2d695aae5a7c13abe67d177aacbd5a3a4 100644 (file)
@@ -9,7 +9,7 @@
     <GtkPrefixDefine>GTK_PREFIX=\"$(GtkDummyPrefix)\"</GtkPrefixDefine>
     <GdkDefines>GDK_COMPILATION;G_LOG_DOMAIN="Gdk"</GdkDefines>
     <GtkIncludedImmodulesDefines>INCLUDE_IM_am_et;INCLUDE_IM_cedilla;INCLUDE_IM_cyrillic_translit;INCLUDE_IM_ime;INCLUDE_IM_inuktitut;INCLUDE_IM_ipa;INCLUDE_IM_multipress;INCLUDE_IM_thai;INCLUDE_IM_ti_er;INCLUDE_IM_ti_et;INCLUDE_IM_viqr</GtkIncludedImmodulesDefines>
-    <GtkDefines>GTK_COMPILATION;G_LOG_DOMAIN="Gtk";GTK_HOST="i686-pc-vs$(VSVer)";GTK_PRINT_BACKENDS="file";GTK_PRINT_PREVIEW_COMMAND="undefined-gtk-print-preview-command";$(GtkIncludedImmodulesDefines);GTK_LIBDIR="$(GtkDummyPrefix)/lib";GTK_DATADIR="$(GtkDummyPrefix)/share";GTK_DATA_PREFIX="$(GtkDummyPrefix)";GTK_SYSCONFDIR="$(GtkDummyPrefix)/etc";MULTIPRESS_CONFDIR="$(GtkDummyPrefix)/etc/gtk-$(ApiVersion)";MULTIPRESS_LOCALEDIR="$(GtkDummyPrefix)/share/locale";GTK_VERSION="$(GtkVersion)/etc";GTK_BINARY_VERSION="$(GtkBinaryVersion)/etc";GDK_DISABLE_DEPRECATED</GtkDefines>
+    <GtkDefines>GTK_COMPILATION;G_LOG_DOMAIN="Gtk";GTK_HOST="i686-pc-vs$(VSVer)";GTK_PRINT_BACKENDS="file";GTK_PRINT_PREVIEW_COMMAND="undefined-gtk-print-preview-command";$(GtkIncludedImmodulesDefines);GTK_LIBDIR="$(GtkDummyPrefix)/lib";GTK_DATADIR="$(GtkDummyPrefix)/share";GTK_DATA_PREFIX="$(GtkDummyPrefix)";GTK_SYSCONFDIR="$(GtkDummyPrefix)/etc";MULTIPRESS_CONFDIR="$(GtkDummyPrefix)/etc/gtk-$(ApiVersion)";MULTIPRESS_LOCALEDIR="$(GtkDummyPrefix)/share/locale";GTK_VERSION="$(GtkVersion)/etc";GTK_BINARY_VERSION="$(GtkBinaryVersion)/etc";GDK_DISABLE_DEPRECATED;ISOLATION_AWARE_ENABLED</GtkDefines>
   </PropertyGroup>
   <PropertyGroup>
     <_PropertySheetDisplayName>gtkbuilddefinesprops</_PropertySheetDisplayName>
@@ -47,4 +47,4 @@
       <Value>$(GtkDefines)</Value>
     </BuildMacro>
   </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
index dd4213b4d7fabcdbb1e60ea4e48e0bc50c2533c7..c90d603112c81e5337bc3b0f2077df3bb6c4aabe 100644 (file)
     <CustomBuild Include="..\..\..\gtk\gtk-win32.rc.in">
       <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generating GTK+ Win32 Version Resource...</Message>
       <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(GenerateGtkWin32RC)</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\gtk\gtk-win32.rc;%(Outputs)</Outputs>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\..\gtk\gtk-win32.rc;..\..\..\gtk\libgtk3.manifest;%(Outputs)</Outputs>
       <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Generating GTK+ Win32 Version Resource...</Message>
       <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(GenerateGtkWin32RC)</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\gtk\gtk-win32.rc;%(Outputs)</Outputs>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\..\gtk\gtk-win32.rc;..\..\..\gtk\libgtk3.manifest;%(Outputs)</Outputs>
       <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Generating GTK+ Win32 Version Resource...</Message>
       <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(GenerateGtkWin32RC)</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\gtk\gtk-win32.rc;%(Outputs)</Outputs>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\..\gtk\gtk-win32.rc;..\..\..\gtk\libgtk3.manifest;%(Outputs)</Outputs>
       <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Generating GTK+ Win32 Version Resource...</Message>
       <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(GenerateGtkWin32RC)</Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\gtk\gtk-win32.rc;%(Outputs)</Outputs>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\gtk\gtk-win32.rc;..\..\..\gtk\libgtk3.manifest;%(Outputs)</Outputs>
     </CustomBuild>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\modules\input\imviqr.c" />
     <ClCompile Include="..\..\..\modules\input\thai-charprop.c" />
   </ItemGroup>
+  <ItemGroup>
+    <Manifest Include="..\..\..\gtk\libgtk3.manifest" />
+  </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="gdk.vcxproj">
       <Project>{fc5aadb5-95cd-4bf0-ba8b-0c16fe7073f7}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
   </ItemGroup>
-  <ItemGroup>
-    <Manifest Include="..\..\..\gtk\libgtk3.manifest" />
-  </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
index 40214a61d710a3d890196a17095896827fc8c16b..733474de4c72cd3b8049c2b63235085fe695a56c 100644 (file)
@@ -40,6 +40,6 @@
        />
        <UserMacro
                Name="GtkDefines"
-               Value="GTK_COMPILATION;G_LOG_DOMAIN=\&quot;Gtk\&quot;;GTK_HOST=\&quot;i686-pc-vs$(VSVer)\&quot;;GTK_PRINT_BACKENDS=\&quot;file\&quot;;GTK_PRINT_PREVIEW_COMMAND=\&quot;undefined-gtk-print-preview-command\&quot;;$(GtkIncludedImmodulesDefines);GTK_LIBDIR=\&quot;$(GtkDummyPrefix)/lib\&quot;;GTK_DATADIR=\&quot;$(GtkDummyPrefix)/share\&quot;GTK_DATA_PREFIX=\&quot;$(GtkDummyPrefix)\&quot;;GTK_SYSCONFDIR=\&quot;$(GtkDummyPrefix)/etc\&quot;;MULTIPRESS_CONFDIR=\&quot;$(GtkDummyPrefix)/etc/gtk-$(ApiVersion)\&quot;;MULTIPRESS_LOCALEDIR=\&quot;$(GtkDummyPrefix)/share/locale\&quot;;GTK_VERSION=\&quot;$(GtkVersion)/etc\&quot;;GTK_BINARY_VERSION=\&quot;$(GtkBinaryVersion)/etc\&quot;;GDK_DISABLE_DEPRECATED"
+               Value="GTK_COMPILATION;G_LOG_DOMAIN=\&quot;Gtk\&quot;;GTK_HOST=\&quot;i686-pc-vs$(VSVer)\&quot;;GTK_PRINT_BACKENDS=\&quot;file\&quot;;GTK_PRINT_PREVIEW_COMMAND=\&quot;undefined-gtk-print-preview-command\&quot;;$(GtkIncludedImmodulesDefines);GTK_LIBDIR=\&quot;$(GtkDummyPrefix)/lib\&quot;;GTK_DATADIR=\&quot;$(GtkDummyPrefix)/share\&quot;GTK_DATA_PREFIX=\&quot;$(GtkDummyPrefix)\&quot;;GTK_SYSCONFDIR=\&quot;$(GtkDummyPrefix)/etc\&quot;;MULTIPRESS_CONFDIR=\&quot;$(GtkDummyPrefix)/etc/gtk-$(ApiVersion)\&quot;;MULTIPRESS_LOCALEDIR=\&quot;$(GtkDummyPrefix)/share/locale\&quot;;GTK_VERSION=\&quot;$(GtkVersion)/etc\&quot;;GTK_BINARY_VERSION=\&quot;$(GtkBinaryVersion)/etc\&quot;;GDK_DISABLE_DEPRECATED;ISOLATION_AWARE_ENABLED"
        />
-</VisualStudioPropertySheet>
\ No newline at end of file
+</VisualStudioPropertySheet>
index 5e574a22e50810f47f11f9769646adbb51ab8aa1..3aa923f5785b7f7d6633bbb265b25ff07ada32c9 100644 (file)
                                </FileConfiguration>
                        </File>
                        <File RelativePath="..\..\..\gtk\gtk-win32.rc" />
-                       <File RelativePath="..\..\..\gtk\libgtk3.manifest"/>
+                       <File RelativePath="..\..\..\gtk\libgtk3.manifest" />
                </Filter>
                <Filter
                        Name="Source Files"